package com.kaishengit.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.dao.DealDao;
import com.kaishengit.dao.core.DateUtil;
import com.kaishengit.pojo.Deal;

@Transactional
public class DealService {
	private DealDao dealDao;

	public void savedeal(Deal deal) {
		deal.setCreatetime(DateUtil.getNow());
		
		dealDao.save(deal);
	}
	
	public List<Deal> findAll(String userid) {
		return dealDao.findBy("userid", userid);
	}
	
	public Deal findById(String id) {
		return dealDao.get(id);
	}
	
	public void del(Deal deal) {
		dealDao.del(deal);
	}
	//set get
	public void setDealDao(DealDao dealDao) {
		this.dealDao = dealDao;
	}
}
